<template>
  <div class="app-container">
    <table-list :data="feedbackList">
      <template slot="columns">
        <el-table-column label="问题类型" align="center" min-width="120px">
          <template slot-scope="scope">
            {{ type[scope.row.type].name }}
          </template>
        </el-table-column>
        <el-table-column label="问题描述" align="center" min-width="120px">
          <template slot-scope="scope">
            {{ scope.row.questionDesc }}
          </template>
        </el-table-column>
        <el-table-column label="联系电话/Email" align="center" min-width="100px">
          <template slot-scope="scope">
            {{ scope.row.connectMode }}
          </template>
        </el-table-column>
         <el-table-column label="提交时间" align="center" min-width="100px">
          <template slot-scope="scope">
            {{ scope.row.createTime | formatTime }}
          </template>
        </el-table-column>
      </template>
    </table-list>

    <list-pagination :total="total" :page="page" :pageSize="pageSize" :handleSizeChange="handleSizeChange" :handleCurrentChange="handleCurrentChange"></list-pagination>
  </div>
</template>

<script>
import list from '@/mixins/List'
import table from '@/components/Table'
import listPagination from '@/components/ListPagination'
import { getFeedbackList } from '@/api/adminOperation'

export default {
  name: 'feedback',
  components: {
    'table-list': table,
    listPagination
  },
  mixins: [list],
  extends: {},
  props: {},
  data () {
    return {
      feedbackList: [],
      type: [
        {
          id: 1,
          name: '功能异常'
        },
        {
          id: 2,
          name: '商品问题'
        },
        {
          id: 3,
          name: '订单问题'
        },
        {
          id: 4,
          name: '返利积分问题'
        },
        {
          id: 5,
          name: '产品建议'
        },
        {
          id: 6,
          name: '其他'
        }
      ]
    }
  },
  computed: {},
  directives: {},
  filters: {},
  created () {},
  mounted () {
    this.getList()
  },
  watch: {},
  methods: {
    async getList () {
      let { data } = await getFeedbackList({
        pageNo: this.page,
        pageSize: this.pageSize
      })
      this.feedbackList = data.dataList
      this.total = data.total
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
